import {Component} from "react";
class A extends Component{
    constructor(props){
        super(props);
        this.statte = {
            name: "katy"
        }
    }

    changeUser(e){
        var name = this.state.name=="katy"?"win7":"katy";
        this.setState({
            name
        })
    }
    render(){
        return 
            <div>
                <div>{this.state.name}</div>
                <div>
                    <button onClick={this.changeUser}>change user</button>
                </div>
            </div>
        
    }
}